<extend name="Base/common" />

<block name="style">
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Api/css/custom.css">
</block>

<block name="Content">

<div class="page-group">
    <div class="page page-custom page-current">
        <header class="recommend-man">
            <img class="avatar" src="{$workerModel['fullpath']|default='__PUBLIC__/Api/images/avatar.png'}">
            <input type="hidden" name="worker_id" id="worker_id" value="{$workerModel['worker_id']}"/>
            <input type="hidden" name="lastIndex" id="lastIndex" value="0"/>
            <div class="info">
                <div class="table">
                    <div class="cell name">{$workerModel['name']}-{$workerModel['account']}</div>
                    <div class="cell full evaluate">
                    	<notempty name="workerModel['score']">
	                    	<for start="0" end="5">
	                   	    	<if condition="$workerModel['score']/2 gt $i">
	                   	    		<span class="heart"></span>
	                   	    	</if>
						    </for>
					    <else/>
					    	<span class="heart"></span>
					    </notempty>
                    </div>
                </div>
                <div class="table">
                    <div class="cell">工号 : {$workerModel['eid']}</div>
                </div>
                <div class="table">
                    <div class="cell">工种 : {:get_dictionary_enum_name('profession_options', $workerModel['profession'])}</div>
                    <div class="cell full text-right">{$workerModel['orders_sum']|default='0'} 单</div>
                </div>
                <div class="table-layout">
                    <div class="cell">从业年数 : {$workerModel['work_year']|default='1'} 年</div>
                    <div class="cell full text-right">{$total} 人点评</div>
                </div>
            </div>
        </header>
        <div class="content">
            <div class="buttons-tab">
                <a href="#tab1" class="tab-link active button">小哥简介</a>
                <a href="#tab2" class="tab-link button">用户评价</a>
            </div>
            <div class="content-custom">
                <div class="tabs">
                    <div id="tab1" class="tab active">
                        <ul class="list-unstyled man-list">
                            {$workerModel['description']|htmlspecialchars_decode}
                        </ul>
                    </div>
                    <div id="tab2" class="tab infinite-scroll">
                        <div class="list-comment">
                        </div>
                        
                        <!-- 加载提示符 -->
	                    <div class="infinite-scroll-preloader">
							<div class="preloader">
	                      	</div>
	                    </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

</block>

<block name="script">
<script type="text/javascript">

var target = Think.U('Worker/ajax_evaluationList');
var params = ['lastIndex', 'worker_id'];
var container = '#tab2 .list-comment';

$("#lastIndex").val('0');

function joinHTML(data){
	
	var html = '';
	var photoURL = './Public/Api/images/icon-user2.png';
	var star = '';
	
	$.each(data, function(key, val){
		
		photoURL = val['fullpath'] ? val['fullpath'] : photoURL;
		star = '';
		
		for (var i=0;i<5;i++){
			if(val['score']/2 > i){
				star += '<span class="heart"></span>';
			}
		}
		
		html += '<div class="comment"><div class="comment-header"><img class="avatar" src="' + photoURL + '">';
		html += '<div class="info"><div class="name">' + val['username'] + '</div><div class="evaluate">' + star;
		html += '</div></div></div><div class="comment-body">' + val['content'] + '</div><div class="comment-footer">';
		html += formatDate(val['create_time']) + '</div></div>';
		
	});
	
	return html;
}

</script>

<script src="__PUBLIC__/Api/js/pageLoading.js" type="text/javascript"></script>
</block>

